<template>
  <div class="page">
    <nav-bar title="党组织列表" theme="white"></nav-bar>
    <div class="event-overview-ranking1">
      <div class="event-overview-ranking1-table">
        <table v-if="organizationlistData.length">
          <thead>
            <tr class="table-thead">
              <th>党组织名称</th>
              <th>组织类别</th>
              <th>党员数</th>
            </tr>
          </thead>
          <tbody>
            <tr
              v-for="(item, index) in organizationlistData"
              :key="index"
              @click="
                $router.push(`/cockpit/analyse/organizationdetail?partyOrganizationCode=${item.partyOrganizationCode}`)
              "
            >
              <td>{{ item.partyOrganizationName }}</td>
              <td>{{ item.partyOrganizationTypeName }}</td>
              <td>{{ item.partyPersonNum }}</td>
            </tr>
          </tbody>
        </table>
        <div class="nodata" v-else>暂无数据</div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
import Cockpit from '@/api/cockpit'
export default {
  data() {
    return {
      organizationlistData: [],
      formdata: {
        regionCode: ''
      }
    }
  },
  computed: {
    ...mapState({
      user: state => state.userInfo
    })
  },
  created() {
    this.formdata.regionCode = this.$route.query.regionCode
    this.organizationlist()
  },
  mounted() {},
  methods: {
    organizationlist() {
      Cockpit.Analyse.organizationlist(this.formdata).then(res => {
        this.organizationlistData = res.data.data.list
      })
    }
  }
}
</script>
<style scoped lang="less">
@import '~@/assets/style/list.less';
@import '~@/assets/style/cockpit/analyse.less';
</style>
